package com.example.mqproduct.ctrl;

import com.example.mqproduct.service.MQService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/mq")
@RestController
public class TestCtrl {

    @Autowired
    private MQService service;

    @RequestMapping("/syncSend/{msg}")
    public Object syncSend(@PathVariable("msg") String msg) {
        return service.syncSend(null, null, msg);
    }

    @RequestMapping("/asyncSend/{msg}")
    public Object asyncSend(@PathVariable("msg") String msg) {
        service.asyncSend(null, null, msg);
        return "ok";
    }
    @RequestMapping("/scheduledSend/{msg}")
    public Object scheduledSend(@PathVariable("msg") String msg) {
        return service.scheduledSend(null, null, msg);
    }
}
